package cn.chinaunicom.sdsi.gacx.sys.service.serviceImpl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.chinaunicom.sdsi.frm.base.BaseService;
import cn.chinaunicom.sdsi.frm.sys.R;
import cn.chinaunicom.sdsi.frm.sys.entity.SysStaff;
import cn.chinaunicom.sdsi.frm.sys.entity.SysStaffOrg;
import cn.chinaunicom.sdsi.gacx.sys.dao.mybatis.GaMainInfoMapper;
import cn.chinaunicom.sdsi.gacx.sys.dao.mybatis.GaSysParamMapper;
import cn.chinaunicom.sdsi.gacx.sys.entity.GaSysParam;
import cn.chinaunicom.sdsi.gacx.sys.service.GaSysParamService;
import cn.chinaunicom.sdsi.gacx.sys.service.SysMainService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * 
 * @author chenxl 20170616
 *
 */
@Service
public class GaSysParamServiceImpl extends BaseService implements GaSysParamService {

	@Autowired
	private GaSysParamMapper gaSysParamMapper;

	/**
	 * 获取首页
	 */
	@Override
	public JSONObject getGaSysParamInfo(String paramTypeId) {
		JSONObject rObj = new JSONObject();
		// 获参数
		List list = gaSysParamMapper.selectByParamTypeId(paramTypeId);
		if (list.size() > 0) {
			GaSysParam param = (GaSysParam) list.get(0);
			rObj.element("paramId", param.getParamId());
			rObj.element("paramName", param.getParamName());
			rObj.element("attribOne", param.getAttibOne());
			rObj.element("attribTwo", param.getAttibOne());
			rObj.element("attribThree", param.getAttibThree());
			rObj.element("returnFlag", "0000");
		} else {
			rObj.element("returnFlag", "0001");
		}

		return rObj;
	}

}